<template>
  <div class="container">
    <template>
      <div style="margin:30px">
        <el-input prefix-icon="el-icon-search" v-model="input" placeholder="请输入内容" style="width:200px"></el-input>&nbsp;
        <el-button type="success" @click="dialogFormVisible = true" icon="el-icon-search" circle></el-button>
        <el-button type="warning" icon="el-icon-zoom-in" @click="dialogFormVisible = true" style="margin-left:20px">高级查找
        </el-button>
      </div>
      <el-button type="primary" class="btn" @click="dialogFormVisible = true"
        icon="el-icon-circle-plus-outline">账单</el-button>
      <el-button type="danger" class="btn" @click="open" icon="el-icon-remove-outline">批量删除</el-button>
      <el-dialog title="新增账单" :visible.sync="dialogFormVisible">
        <el-form :model="form">
          <el-form-item label="应付金额" :label-width="formLabelWidth">
            <el-input v-model="form.username" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="编码" :label-width="formLabelWidth">
            <el-input v-model="form.encode" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="账单状态" :label-width="formLabelWidth">
            <el-input v-model="form.encode" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="创建时间" :label-width="formLabelWidth">
            <el-input v-model="form.encode" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="备注" :label-width="formLabelWidth">
            <el-input v-model="form.encode" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="合计" :label-width="formLabelWidth">
            <el-input v-model="form.encode" autocomplete="off"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取消</el-button>
          <el-button type="primary" @click="dialogFormVisible = false; add()">添加</el-button>
        </div>
      </el-dialog>
      <div class="formContainer">
        <el-table :data="tableData"  style="width: 140vh" max-height="460"  :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }" >
          <el-table-column type="selection" width="45" label="全选"></el-table-column>
          <el-table-column  type="expand" width="20">
            销售订单id
          </el-table-column>
          <el-table-column  prop="id" label="账单id" width="70" fixed="left">
          </el-table-column>
          <el-table-column prop="customername" label="应付金额" width="150">
          </el-table-column>
          <el-table-column prop="encode" label="编码" width="150">
          </el-table-column>
          <el-table-column prop="status" label="账单状态" width="150">
          </el-table-column>
          <el-table-column prop="addtime" label="创建时间" width="150">
          </el-table-column>
          <el-table-column prop="suppliergroup" label="备注" width="90">
          </el-table-column>
          <el-table-column prop="suppliergroup" label="合计" width="90">
          </el-table-column>
          <el-table-column label="操作" width="150">
            <template slot-scope="scope">
              <el-button type="success" circle size="mini">回款</el-button>
            <el-button type="danger" icon="el-icon-delete" circle size="mini"></el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination align="center" style="margin: 8px" @size-change="handleSizeChange"
          @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40]"
          :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="all">
        </el-pagination>
      </div>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formLabelWidth: '120px',
      dialogFormVisible: false,
      form: {
        username: '111',
        password: '111',
        code: '111',
        id: '111',
        encode: '',
        supplier: ''
      }, tableData: [{
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        status: '已收款',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        status: '未收款',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, , {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, , {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }, , {
        id: '1',
        suppliername: '王小虎',
        encode: '123567',
        group: '1',
        name: '2002',
        phonenumber: '23311341',
        suppliergroup: '12',
        addtime: '20020217'
      }]
    }
  }
}
</script>

<style lang="less" scoped>
.formContainer {
  padding: 5px 20px;
}
</style>